#include <iostream> 
#include <cstring>
#include <cmath>
using namespace std;
int n;
int stu[1030][1030];
void dfs(int x1,int y1,int x2,int y2){
	if(x1==x2&&y1==y2) return;
	for(int i=x1;i<=(x1+x2)/2;i++){
		for(int j=y1;j<=(y1+y2)/2;j++){
			stu[i][j]=1;
		}
	}
	dfs((x1+x2)/2+1,y1,x2,(y1+y2)/2);
	dfs((x1+x2)/2+1,(y1+y2)/2+1,x2,y2);
	dfs(x1,(y1+y2)/2+1,(x1+x2)/2,y2);
	
}
int main(int argc, char** argv) {
	cin>>n;
	int k=pow(2,n);
	dfs(1,1,k,k);
	for(int i=1;i<=k;i++){
		for(int j=1;j<=k;j++){
			if(stu[i][j]==0){
				cout<<1<<" ";
			}else{
				cout<<0<<" ";
			}
		}
		cout<<endl;
	}
	return 0;
}
